how to calculate the common difference of AP